﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;
using System.Threading;

namespace TestConsole
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.Write("Number of messages (default = 100): ");
            int number;
            if (!int.TryParse(Console.ReadLine(), out number))
                   number = 100;
            int count = 0;
            Stopwatch watch = new Stopwatch();
            watch.Start();
            while (count ++ < number)
            {
//                Trace.Write(count);
                Trace.Write(DateTime.Now.ToString() + ": Test Message #" + count.ToString(), "Information");
                if (count % 10 == 0)
                    Console.WriteLine(count);
                //                System.Threading.Thread.Sleep(50);
            }
            Trace.Close();
            watch.Stop();

            System.Console.WriteLine("Duration: " + watch.Elapsed.ToString());

            System.Console.ReadLine();
        }
    }
}
